package com.example.hospital.mapper;

import com.example.hospital.domain.entity.PackageItem;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PackageItemMapper {
    @Insert("INSERT INTO package_item (package_id, indicator_id) VALUES (#{packageId}, #{indicatorId})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(PackageItem item);

    @Delete("DELETE FROM package_item WHERE id=#{id}")
    int delete(@Param("id") Long id);

    @Select("SELECT * FROM package_item WHERE package_id=#{packageId}")
    List<PackageItem> listByPackageId(@Param("packageId") Long packageId);
}